package com.leo.train.member.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

//drop table if exists `ticket`;
//create table `ticket` (
//        `id` bigint not null comment 'id',
//        `member_id` bigint not null comment '会员id',
//        `passenger_id` bigint not null comment '乘客id',
//        `passenger_name` varchar(20) comment '乘客姓名',
//        `train_date` date not null comment '日期',
//        `train_code` varchar(20) not null comment '车次编号',
//        `carriage_index` int not null comment '箱序',
//        `seat_row` char(2) not null comment '排号|01, 02',
//        `seat_col` char(1) not null comment '列号|枚举[SeatColEnum]',
//        `start_station` varchar(20) not null comment '出发站',
//        `start_time` time not null comment '出发时间',
//        `end_station` varchar(20) not null comment '到达站',
//        `end_time` time not null comment '到站时间',
//        `seat_type` char(1) not null comment '座位类型|枚举[SeatTypeEnum]',
//        `create_time` datetime(3) comment '新增时间',
//        `update_time` datetime(3) comment '修改时间',
//primary key (`id`),
//index `member_id_index` (`member_id`)
//        ) engine=innodb default charset=utf8mb4 comment='车票';

@Data
public class Ticket {
    private Long id;
    private Long memberId;
    private Long passengerId;
    private String passengerName;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date trainDate;
    private String trainCode;
    private Integer carriageIndex;
    private String seatRow;
    private String seatCol;
    private String startStation;
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date startTime;
    private String endStation;
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date endTime;
    private String seatType;
    private Date createTime;
    private Date updateTime;
}
